from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class XueXiPage(Base):
    fangdajing=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.ImageView')
    ershida=(By.XPATH,'//android.widget.TextView[@text="二十大报告"]')

    dy=(By.XPATH,'//android.view.View[@text="全部"]')

    def sousuoyewu(self):
        self.find_ele(self.fangdajing).click()
        sleep(3)
        self.find_ele(self.ershida).click()
        sleep(3)

    sanhenggang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout[1]/androidx.viewpager.widget.ViewPager/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ImageView')
    yaowen=(By.XPATH,'//android.widget.TextView[@text="要闻"]')

    dy_toutiao=(By.XPATH,'//android.widget.TextView[@text="头条"]')

    def yaowenyewu(self):
        self.find_ele(self.sanhenggang).click()
        sleep(2)
        self.find_ele(self.yaowen).click()
        sleep(2)

